package com.azdebugit.spring.auto.enable.test;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

//新建了一个启动类，使用这个注解
//这里我需要获取helloWorld的bean，所以我需要在将helloWorld的bean通过这个注解进行自动装配
//@EnableAutoConfiguration(exclude = ".stringRedisTemplate")
@EnableAutoConfiguration
public class EnableAutoConfigurationBootStrap {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(EnableAutoConfigurationBootStrap.class)
                .web(WebApplicationType.NONE)
                .run(args);
        System.out.println("#################"+"helloWorld:");
        String helloWorld = context.getBean("helloWorld", String.class);
        System.out.println("helloWorld:" + helloWorld);
    }
}